using System;
using Microsoft.SPOT;

using EmbeddedWebserver.Core;
using EmbeddedWebserver.Core.Handlers.Abstract;

namespace HttpIntfLib
{
    class UartDriver:HandlerBase
    {
        #region Non-public members

        /* 
         * UART?com=[1-4]  : provide status .. 
         * UART?ReserverPort=[1-4] (Key will be provided in reponse)         
         * Response will provide a TCP/IP port for proxying serial port.. 
         * UART?ClosePort=[1-4]&Key=8989899
         * UART?CloseConnections=[1-4]&Key=8989899 ( close all TCP connections of a port) 
         */
        protected override void ProcessRequestWorker(HttpContext pContext)
        {
            pContext.Response.ResponseBody = "Hello world!";
            /*
            Random _generator = new Random();
            int retval = _generator.Next();
            pContext.Response.ResponseBody = "{ \"value\": " + retval + "}";
            pContext.Response.ContentType = "application/json";
             * */

        }

        #endregion

        #region Constructors

        public UartDriver() : base(HttpMethods.GET) {  // TBD 
        }

        #endregion
    }
}
